<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// 检测当前权限，进行路由分发
Route::get('/', 'Controller@redirect');

// 获奖成果上传 from、excel表格式上传获奖记录
Route::get('/admin/upload/uploadexcel', 'Admin\Upload\UploadController@uploadExcel');
Route::post('admin/upload/uploadaward', 'Admin\Upload\UploadController@uploadAward');
Route::post('admin/upload/readAndStorage', 'Admin\Upload\UploadController@readAndStorage');

// 教学建设上传 form、excel格式上传
Route::get('admin/upload/uploadConstrExcel', 'Admin\Upload\UploadController@uploadConstrExcel');
Route::post('admin/upload/uploadconstruction', 'Admin\Upload\UploadController@uploadConstruction');
Route::post('admin/upload/readConstrExcel', 'Admin\Upload\UploadController@readConstrExcel');

// 学术成果上传
Route::get('admin/upload/uploadAcademicExcel', 'Admin\Upload\UploadController@uploadAcademicExcel');
Route::post('admin/upload/uploadAcademic', 'Admin\Upload\UploadController@uploadAcademic');
Route::post('admin/upload/readAcademicExcel', 'Admin\Upload\UploadController@readAcademicExcel');


// 个人档案获奖成果及教学建设路由
Route::get('admin/archives/awardsdata', 'Admin\Archives\ArchivesController@awardsdata');
Route::get('admin/archives/constrdata', 'Admin\Archives\ArchivesController@constrdata');

// 获奖成果管理
Route::get('admin/award/awarddata', 'Admin\Award\AwardController@awardData');
// 获奖成果类别数据接口
Route::get('admin/award/categorydata', 'Admin\Award\AwardController@categoryData');

// 教学建设类管理
Route::get('admin/construction/awarddata', 'Admin\Construction\ConstructionController@awardData');
// 教学建设成果类别数据接口
Route::get('admin/construction/categorydata', 'Admin\Construction\ConstructionController@categoryData');



Route::group(['namespace' => 'Auth', 'middleware' => 'language'], function ($router)
{
	// login认证路由
	$router->get('login', 'LoginController@showLoginForm')->name('login');
	$router->post('login', 'LoginController@login');
	$router->post('logout', 'LoginController@logout');
	// register注册路由
	$router->get('register', 'RegisterController@showRegisterForm');
	$router->post('register','RegisterController@register');

});

Route::group(['prefix' => 'admin','namespace' => 'Admin', 'middleware' => ['auth', 'language']],function ($router)
{
	$router->get('/','HomeController@index');
	// 首页留言反馈ajax路由
	$router->post('/home/note', 'HomeController@note');
	// 首页下载模板文件 
	$router->get('/home/awardExcelDownload', 'HomeController@awardExcelDownload');
	$router->get('/home/constrExcelDownload', 'HomeController@constrExcelDownload');
	$router->get('/home/academicExcelDownload', 'HomeController@constrExcelDownload');

	// 教学结果上传界面路由
	$router->resource('/upload', 'Upload\UploadController');
	// ajax上传获奖信息路由
	// $router->post('/upload/uploadaward', 'Upload\UploadController@uploadAward');

	// 教学建设上传界面路由
	$router->get('/constructionupload', 'Upload\UploadController@ConstructionUploadIndex');

	// 学术成果上传界面路由
	$router->get('/academicupload', 'Upload\UploadController@academicuploadIndex');

	// 教师个人荣誉档案界面路由
	$router->resource('/archives', 'Archives\ArchivesController');
	// $router->get('/archives/awardsdata', 'Archives\ArchivesController@awardsData');
	// 修改个人档案记录信息
	$router->get('/archives/edit/{id}', 'Archives\ArchivesController@edit');

	// 教师用户修改个人密码界面路由
	$router->resource('/updatepassword', 'Updatepassword\UpdatepasswordController');
	// ajax上传教师用户修改基本信息
	$router->post('/updatepassword/editinfo', 'Updatepassword\UpdatepasswordController@editInfo');

	// 业绩分汇总——业绩分分类汇总表界面路由
	$router->get('/performancescore/summarytable', 'Performancescore\PerformancescoreController@summarytable');

	// 权限
	$router->resource('permission', 'PermissionController');
	// 角色
	$router->resource('role', 'RoleController');
	// 用户
	$router->resource('user', 'UserController');
	// 菜单
	$router->get('menu/clear', 'MenuController@cacheClear');

	// 荣誉管理——获奖成果管理
	$router->resource('/award', 'Award\AwardController');
	// 获奖类别管理首页
	$router->get('/awardcategory', 'Award\AwardController@AwardcategoryIndex');
	// 获奖成果类别管理数据
	// $router->get('/award/categorydata', 'Award\AwardController@categoryData');

	// 荣誉管理——教学建设成果管理
	$router->resource('/construction', 'Construction\ConstructionController');
	// 教学建设成果类别管理首页
	$router->get('/constructioncategory', 'Construction\ConstructionController@constructionCategoryIndex');

	$router->resource('menu', 'MenuController');
	$router->get('setting/{lang}', 'SettingController@language');
});